<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>文章列表</h2>
    </div>

    <div class="cf">
        <a class="btn" href="{:U('add')}">新 增</a>
        <button class="btn ajax-post confirm" url="{:U('delete')}" target-form="ids">删 除</button>
    </div>

    <div class="data-table table-striped">
        <form class="ids">
            <table>
                <thead>
                    <tr>
                        <th class="row-selected"><input class="checkbox check-all" type="checkbox"></th>
                        <th>编号</th>
                        <th>标题</th>
                        <th>系统</th>
                        <th>版本号</th>
                        <th>Hash</th>
                        <th>更新地址</th>
                        <th>是否强制更新</th>
                        <th>创建时间</th>
                        <th>修改时间</th>                      
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
				<notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td><input class="ids row-selected" type="checkbox" name="id[]" value="{$vo.id}"></td>
                        <td>{$vo.id}</td>                      
                       	<td>{$vo.title}</td>
                       	<td>{$vo.os}</td>                     
                       	<td>{$vo.number}</td>                     
                       	<td>{$vo.hash}</td>                     
                       	<td>{$vo.url}</td>                     
                       	<td>{$vo.mask_text}</td>                     
                        <td>{$vo.create_time|time_format}</td>
                        <td>{$vo.update_time|time_format}</td>                      
                        <td>
                            <a title="编辑" href="{:U('edit?id='.$vo['id'])}">编辑</a>
                            <a class="confirm ajax-get" title="删除" href="{:U('delete?id='.$vo['id'])}">删除</a>
                        </td>
                    </tr>
                </volist>
				<else/>
				<td colspan="11" class="text-center"> aOh! 暂时还没有内容! </td>
				</notempty>
                </tbody>
            </table>
        </form>
        <!-- 分页 -->
        <div class="page">

        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        $(function() {
            //搜索功能
            $("#search").click(function() {
                var url = $(this).attr('url');
                var query = $('.search-form').find('input').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });
            //回车搜索
            $(".search-input").keyup(function(e) {
                if (e.keyCode === 13) {
                    $("#search").click();
                    return false;
                }
            });
            //导航高亮
            highlight_subnav('{:U('index')}');
        });
    </script>
</block>